#ifndef LOGINWINDOW_H
#define LOGINWINDOW_H

#include <QWidget>
#include <QTcpSocket>
#include <QMessageBox>
#include <QJsonObject>
#include "protocol.h"
#include <QJsonDocument>
#include <QByteArray>
#include "SocketManager.h"
class RegisterWindow;


namespace Ui {
class LoginWindow;
}

class LoginWindow : public QWidget
{
    Q_OBJECT

public:
    explicit LoginWindow(QWidget *parent = nullptr);
    ~LoginWindow();

private slots:
    void handleconnected();

    void on_login_clicked();

    void on_Register_clicked();

    //void handleTORead();

    void handleLoginResponse(QJsonObject obj);

    //QTcpSocket* getsocket();

private:
    Ui::LoginWindow *ui;
    RegisterWindow* reg = nullptr;

//    QString pendingUsername;
//    QString pendingPassword;
};

#endif // LOGINWINDOW_H
